package com.gm.controller;


import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/spring/index")
public class IndexJspController {
	@RequestMapping("main")
	public String index(HttpServletRequest request){
		//StandardWrapper
		System.out.println(request.getContextPath());
		//System.out.println(request.get);
		System.out.println(request.getServletPath());
		System.out.println(request.getRequestURI());
		System.out.println(request.getRequestURL());
		return "index";
	}
	
	@RequestMapping("hi.html")
	public void indexJsp(HttpServletRequest request,HttpServletResponse response) throws IOException{
		//StandardWrapper
		System.out.println(request.getContextPath());
		//System.out.println(request.get);
		System.out.println(request.getServletPath());
		System.out.println(request.getRequestURI());
		System.out.println(request.getRequestURL());
		response.getWriter().write("hi from here");
	}
}
